#pragma once

#include <string>
#include <map>
#include <filesystem>
#include <opencv2/opencv.hpp>

enum DictMode
{
    DictMode_Unknown = 0,
    DictMode_SingleWord = 1,
    DictMode_MultiWord = 2,

};
struct DictContent
{
    std::wstring name_;
    std::wstring res_name_;
    // std::string tolerance_;
    // std::string color_;

    cv::Mat mat_;
};

struct DictInfo
{
    std::wstring name_;
    std::wstring tolerance_;
    std::wstring color_;
    DictMode mode_ = DictMode_SingleWord;
};
class Dict
{
public:
    Dict() = default;

    bool loadFromFile(const std::filesystem::path &file_path);

    bool saveToFile(const std::filesystem::path &file_path) const;

    void addDict(const DictContent &dict);

    // false:已经设置过了
    bool setDictInfo(const DictInfo &dict_info);

public:
    std::map<std::wstring, DictContent> dicts_;
    DictInfo dict_info_;
};